MoE multi-chip experts example#720
Open
puddingfjz wants to merge 2 commits intohw-native-sys:mainfrom
Open
Conversation
Test Configuration: - 4 experts (one per chip) - 10 tokens in context - 4 tokens processed per expert - Hidden dimension: 16 IMPORTANT: Current implementation tests DATA FLOW only, not actual MoE computation: - Compute phase is a simple +1.0 operation, not expert network computation - Focus is on verifying correct token routing and result gathering - Can be extended to add real expert models later Core Components: - Kernels: dispatch (all-to-all), compute (+1.0), combine (all-to-all) - Orchestration: end2end, dispatch-only, combine-only, dispatch+compute - Unit Tests: test_dispatch_only, test_combine_only, test_dispatch_compute - E2E Test: test_end2end with unique value tracing KEY DESIGN: Use INDEPENDENT scratch_test buffer for combine phase - Problem: Reusing scratch caused combine to read stale dispatch data - Solution: Dispatch+Compute use scratch, Combine uses scratch_test - Prevents corruption when combine's stage-in doesn't fully overwrite dispatch's data (writes 4 tokens, stride based on 10 NUM_TOKENS) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
94fe535 to
1fb325a
Compare
- Keep the example focused on the end-to-end dispatch, compute, and combine path - Remove obsolete debug docs, partial tests, and unused kernel variants - Align README, test naming, and scratch buffer handling with the current two-chip hardware test
1fb325a to
d47f536
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a focused L3 example for a distributed MoE-style workflow with
one expert per chip.
The example demonstrates:
recvbufferThe pipeline is intentionally small (
NUM_TOKENS = 10,HIDDEN_DIM = 16,COUNT = 4) so the data movement is easy to inspect while still exercisingdispatch, compute, and combine across chips.
Testing
conda run -n simpler_issue python3 -m py_compile examples/workers/l3/moe_multi_chip_experts/main.py examples/workers/l3/moe_multi_chip_experts/ test_moe_multi_chip_experts.pytask-submiton devices9,10:1 passed in 8.50s